#ifndef __CUST_DMA_H__
#define __CUST_DMA_H__

#define DMA_DONE	(1)
#define DMA_HALF_DONE	(2)
#define DMA_ERROR	(3)

enum
{
	DMA_CHANNEL_1,
	DMA_CHANNEL_2,
	DMA_CHANNEL_3,
	DMA_CHANNEL_4,
	DMA_CHANNEL_5,
#if (defined STM32F0)
	DMA_CHANNEL_MAX,
#endif
	DMA_CHANNEL_6,
	DMA_CHANNEL_7,
#if (defined STM32L0)
	DMA_CHANNEL_MAX,
#endif
};

typedef struct
{
	MyCBFun_t CB;
}DMA_CtrlStruct;
uint32_t DMA_Start(uint8_t Channel, uint32_t Config, MyCBFun_t CB, uint32_t DevAddr, uint32_t MemAddr, uint16_t Len);
void DMA_Stop(uint8_t Channel);
uint32_t DMA_GetSize(uint8_t Channel);
uint32_t DMA_Busy(uint8_t Channel);
#endif
